#!/bin/bash
if [ `uname` ==  "FreeBSD" ] ; then {
	sysctl hw.model | grep  Intel
} ; else {
	cat /proc/cpuinfo | grep  GenuineIntel 
} ; fi

if [ $? = 0 ] ; then {
	nice -n 15 ./bin/burnP6
}; else {
	nice -n 15 ./bin/burnK7
} ; fi

x="$?"
if [ $x != 0 ] ; then {
	echo burnCPU exited code $x
	if [ $x = 254 ] ; then {
		echo integer error
	} ; elif [ $x = 255 ] ; then {
		echo floating point error
	} ; else {
		echo unknown error
	} ; fi
	exit 1
} ; fi
exit 0
